home *** CD-ROM | disk | FTP | other *** search
/ Champak 123 / (Vol 123) Jan 13 2011.iso / Games / go-fishing.swf / scripts / DefineSprite_219 / frame_15 / DoAction.as
Text File  |  2011-01-13  |  780b  |  36 lines

  1. fishhook_y = getProperty("/ship/fishhook", _Y);
  2. fish_x = getProperty(my_name, _X);
  3. fish_y = getProperty(my_name, _Y);
  4. delta_x = eval("/:fishhook_x") - fish_x;
  5. delta_y = fishhook_y - fish_y;
  6. if(eval("/:hit") == "1")
  7. {
  8.    if((fishhook_width + fish_width) * (fishhook_width + fish_width) >= delta_x * delta_x + delta_y * delta_y)
  9.    {
  10.       gotoAndPlay(24);
  11.       set("/:hit","0");
  12.       set("/:movie_enable","0");
  13.       l = "0";
  14.    }
  15. }
  16. if(fish_x < "0")
  17. {
  18.    gotoAndStop(1);
  19.    set("/:count","/:count - 1");
  20.    set("/:a7","0");
  21.    setProperty(my_name, _X, former_x);
  22.    setProperty(my_name, _Y, former_y);
  23. }
  24. else
  25. {
  26.    setProperty(my_name, _X, fish_x - speed);
  27. }
  28. if(turn_o == "3")
  29. {
  30.    turn = random("30");
  31. }
  32. if(turn == "19")
  33. {
  34.    gotoAndPlay(5);
  35. }
  36.